package com.ssy.lingxi.member.merchant.controller.web;

import com.ssy.lingxi.common.response.Wrapper;
import com.ssy.lingxi.member.merchant.model.vo.basic.request.MemberDetailVO;
import com.ssy.lingxi.member.merchant.model.vo.basic.response.MemberConfigGroupVO;
import com.ssy.lingxi.member.merchant.model.vo.login.response.MemberRegisterTypeMenuVO;
import com.ssy.lingxi.member.merchant.service.web.IMemberRegisterService;
import org.springframework.http.HttpHeaders;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.List;

/**
 * @menu 企业商城门户 - 会员注册页面内容接口
 * @author 万宁
 * @version 2.0.0
 * @date 2020-05-30
 */
@RestController
@RequestMapping("/member/menu/register")
public class MemberMenuController {

    @Resource
    private IMemberRegisterService memberRegisterService;

    /**
     * 注册页面 - 获取用户类型、业务类型
     * @param headers Http头部信息
     * @return 查询结果
     */
    @RequestMapping(value = "/type", method = RequestMethod.GET)
    public Wrapper<List<MemberRegisterTypeMenuVO>> getRegisterTypeMenu(@RequestHeader HttpHeaders headers) {
        return memberRegisterService.getRegisterTypePageContent(headers);
    }

    /**
     * 注册页面 - 获取完善用户资料页面内容
     * @param headers Http头部信息
     * @param detailVO 接口参数
     * @return 查询结果
     */
    @RequestMapping(value = "/detail", method = RequestMethod.GET)
    public Wrapper<List<MemberConfigGroupVO>> getRegisterDetailMenu(@RequestHeader HttpHeaders headers, @Valid MemberDetailVO detailVO) {
        return memberRegisterService.getRegisterDetailPageContent(headers, detailVO);
    }
}
